
local indata LAD\Data
local infile LAD\Data_Cleaning

use "`indata'\LAD_Crowdout.dta", clear

do "`infile'\LAD_Commands_filtering.do"

keep if empinc>=-6000 & empinc<6000

gen Z=empinc
kdensity Z
graph export Histograms_K_EmpInc.emf, replace
drop Z

gen Z=empinc
kdensity Z if penadj>0
graph export Histograms_K_EmpInc_yesRPP.emf, replace
drop Z

gen Z=empinc
kdensity Z if penadj==0 & dues>0
graph export Histograms_K_EmpInc_noRPP_yesUnion.emf, replace
drop Z

gen Z=empinc
kdensity Z if penadj==0 & dues==0
graph export Histograms_K_EmpInc_noRPP_noUnion.emf, replace
drop Z

*--------------
*1) Full sample
*--------------

twoway__histogram_gen empinc, percent bin(60) gen(x h)
list x h if x!=. & h!=., noobs clean
drop x h
hist empinc, lwidth(thin) lcolor(black) fcolor(gs10) bin(60) percent xscale(r(-6000(3000)6150)) xlabel(-6000(3000)6150, labgap(2) tposition(inside) format(%9.0gc)) xtitle("Employment income relative to the kink", margin(0 0 0 2)) xline(6150, lwidth(thin) lcolor(black)) yscale(r(0(0.5)2.5)) ylabel(0(0.5)2.5, labgap(2) angle(horizontal) noticks glcolor(gs13) format(%9.1f)) yline(2.5, lwidth(thin) lcolor(black)) ytitle("") graphregion(color(white)) bgcolor(white) plotregion(margin(0)) title("Percent", justification(left) placement(west) margin(-8 0 5 0) tstyle(body)) scale(1.2)
graph export Histograms_EmpInc.emf, replace
graph export Histograms_EmpInc.eps, replace
gen Z=empinc
DCdensity Z, breakpoint(0) generate(Xj Yj r0 fhat se_fhat) b(400) h(230.9985)
graph export Histograms_DC_EmpInc.emf, replace
drop Z Xj Yj r0 fhat se_fhat

*--------------
*2) RPP Members
*--------------

twoway__histogram_gen empinc if penadj>0, percent bin(60) gen(x h)
list x h if x!=. & h!=., noobs clean
drop x h
hist empinc if penadj>0, lwidth(thin) lcolor(black) fcolor(gs10) bin(60) percent xscale(r(-6000(3000)6150)) xlabel(-6000(3000)6150, labgap(2) tposition(inside) format(%9.0gc)) xtitle("Employment income relative to the kink", margin(0 0 0 2)) xline(6150, lwidth(thin) lcolor(black)) yscale(r(0(0.5)2.5)) ylabel(0(0.5)2.5, labgap(2) angle(horizontal) noticks glcolor(gs13) format(%9.1f)) yline(2.5, lwidth(thin) lcolor(black)) ytitle("") graphregion(color(white)) bgcolor(white) plotregion(margin(0)) title("Percent", justification(left) placement(west) margin(-8 0 5 0) tstyle(body)) scale(1.2)
graph export Histograms_EmpInc_yesRPP.emf, replace
graph export Histograms_EmpInc_yesRPP.eps, replace
gen Z=empinc
DCdensity Z if penadj>0, breakpoint(0) generate(Xj Yj r0 fhat se_fhat) b(400) h(230.9985)
graph export Histograms_DC_EmpInc_yesRPP.emf, replace
drop Z Xj Yj r0 fhat se_fhat

*----------------------------
*3) Unionized RPP Non-members
*----------------------------

twoway__histogram_gen empinc if penadj==0 & dues>0, percent bin(60) gen(x h)
list x h if x!=. & h!=., noobs clean
drop x h
hist empinc if penadj==0 & dues>0, lwidth(thin) lcolor(black) fcolor(gs10) bin(60) percent xscale(r(-6000(3000)6150)) xlabel(-6000(3000)6150, labgap(2) tposition(inside) format(%9.0gc)) xtitle("Employment income relative to the kink", margin(0 0 0 2)) xline(6150, lwidth(thin) lcolor(black)) yscale(r(0(0.5)2.5)) ylabel(0(0.5)2.5, labgap(2) angle(horizontal) noticks glcolor(gs13) format(%9.1f)) yline(2.5, lwidth(thin) lcolor(black)) ytitle("") graphregion(color(white)) bgcolor(white) plotregion(margin(0)) title("Percent", justification(left) placement(west) margin(-8 0 5 0) tstyle(body)) scale(1.2)
graph export Histograms_EmpInc_noRPP_yesUnion.emf, replace
graph export Histograms_EmpInc_noRPP_yesUnion.eps, replace
gen Z=empinc
DCdensity Z if penadj==0 & dues>0, breakpoint(0) generate(Xj Yj r0 fhat se_fhat) b(400) h(230.9985)
graph export Histograms_DC_EmpInc_noRPP_yesUnion.emf, replace
drop Z Xj Yj r0 fhat se_fhat

*--------------------------------
*4) Non-unionized RPP Non-members
*--------------------------------

twoway__histogram_gen empinc if penadj==0 & dues==0, percent bin(60) gen(x h)
list x h if x!=. & h!=., noobs clean
drop x h
hist empinc if penadj==0 & dues==0, lwidth(thin) lcolor(black) fcolor(gs10) bin(60) percent xscale(r(-6000(3000)6150)) xlabel(-6000(3000)6150, labgap(2) tposition(inside) format(%9.0gc)) xtitle("Employment income relative to the kink", margin(0 0 0 2)) xline(6150, lwidth(thin) lcolor(black)) yscale(r(0(0.5)2.5)) ylabel(0(0.5)2.5, labgap(2) angle(horizontal) noticks glcolor(gs13) format(%9.1f)) yline(2.5, lwidth(thin) lcolor(black)) ytitle("") graphregion(color(white)) bgcolor(white) plotregion(margin(0)) title("Percent", justification(left) placement(west) margin(-8 0 5 0) tstyle(body)) scale(1.2)
graph export Histograms_EmpInc_noRPP_noUnion.emf, replace
graph export Histograms_EmpInc_noRPP_noUnion.eps, replace
gen Z=empinc
DCdensity Z if penadj==0 & dues==0, breakpoint(0) generate(Xj Yj r0 fhat se_fhat) b(400) h(230.9985)
graph export Histograms_DC_EmpInc_noRPP_noUnion.emf, replace
drop Z Xj Yj r0 fhat se_fhat

exit